﻿#include "jointview.h"
#include "ui_jointview.h"

JointView *JointView::_Jointv=nullptr;
JointView::JointView(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::JointView)
{
    ui->setupUi(this);
}

JointView::~JointView()
{
    delete ui;
}

JointView *JointView::Instance()
{
    if(JointView::_Jointv==nullptr)
    {
        _Jointv=new JointView();
    }
    return _Jointv;
}

void JointView::setValues(std::vector<double> Q)
{
    if(Q.size()<6)
        return;
    ui->doubleSpinBox_joint_1->setValue(Q.at(0));
    ui->doubleSpinBox_joint_2->setValue(Q.at(1));
    ui->doubleSpinBox_joint_3->setValue(Q.at(2));
    ui->doubleSpinBox_joint_4->setValue(Q.at(3));
    ui->doubleSpinBox_joint_5->setValue(Q.at(4));
    ui->doubleSpinBox_joint_6->setValue(Q.at(5));
}
